package com.xwli.springcloud.gof23.strategy.subclass;

import com.xwli.springcloud.gof23.strategy.Duck;
import com.xwli.springcloud.gof23.strategy.behavior.impl.FlyWithWings;
import com.xwli.springcloud.gof23.strategy.behavior.impl.Quack;

/**
 * @author xwli
 * @date: 2022/2/25 10:22
 * @desc  鸭子子类-绿头鸭
 * @since JDK 1.8
 */
public class MallardDuck extends Duck {

    public MallardDuck(){
        quackBehavior = new Quack();
        flyBehavior = new FlyWithWings();
    }

    @Override
    public void display() {
        System.out.println("我是一只绿头鸭");
    }
}

